﻿


using IotContract.Enums;
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XT.Common.Extensions;

namespace IotContract.Dtos.Servers.Pushs;
/// <summary>
/// 扫码枪推送
/// </summary>
[ProtoContract]
public class PushBcrDto:PushEquipDto
{
    /// <summary>
    /// 读取状态
    /// </summary>
    [ProtoMember(1)]
    public BcrProcessStepType ReadingStep { get; set; }
 
   
    /// <summary>
    /// 接收时间
    /// </summary>
    [ProtoMember(2)]
    public DateTime? RecieveTime { get; set; }
    /// <summary>
    /// 写入id
    /// </summary>
    [ProtoMember(3)]
    public string WriteId { get; set; }

    /// <summary>
    /// 绑定单元号
    /// </summary>
    [ProtoMember(4)]
    public string UnitNum { get; set; }
    /// <summary>
    /// 绑定号
    /// </summary>
    [ProtoMember(5)]
    public string BindNum { get; set; }

    /// <summary>
    /// 排序号
    /// </summary>
    [ProtoMember(6)]
    public int OrderNum { get; set; }

    /// <summary>
    /// IP端口地址
    /// </summary>
    [ProtoMember(7)]
    public string IPAddress { get; set; }

    /// <summary>
    /// 读取正常数据
    /// </summary>
    public bool IsReadOK
    {
        get
        {
            return Value.IsNotNullOrEmpty() && Value != "ERROR";
        }
    }
}
